home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tch_tpas.zip / PROG3.PAS < prev    next >
Pascal/Delphi Source File  |  1986-04-05  |  2KB  |  48 lines

  1. PROGRAM PROG3;
  2. {$U+          Copyright (C), 1985 by Lyle Faurot.  All rights reserved.
  3.  
  4.    New Topics: Comments
  5.                Output with the Write and WriteLn statements
  6.                Compiler directive - $U+
  7.  
  8.    Note that this block of comments, extending over several lines
  9.    is included between a single set of brackets at the left.
  10.  
  11.    $U+ is a special form of comment, called a compiler directive.
  12.    This directive, $U+, will appear in most of the sample programs
  13.    to make sure you can terminate a program without having to reboot.
  14.    (More about compiler directives later.)
  15.  
  16. }
  17.  
  18. (*  Parentheses and asterisks can also be used to enclose a comment *)
  19.  
  20. BEGIN
  21.   WriteLn('* * * * * * * * * * * * * * * * * *');  {Note that comments      }
  22.   WriteLn('*                                 *');  {placed at the end of a  }
  23.   WriteLn('*          TURBO-LESSON 3         *');  {statement line should   }
  24.   WriteLn('*                                 *');  {be bracketed on the     }
  25.   WriteLn('*  Edited, Compiled, Executed by  *');  {same line.  A multiline }
  26.   WriteLn('*       (put your name here)      *');  {comment, like the one at}
  27.   WriteLn('*                                 *');  {the beginning of this   }
  28.   WriteLn('* * * * * * * * * * * * * * * * * *');  {program would include   }
  29.   {    some of the non-comment statements, making them ineffective.         }
  30.  
  31.   {The fact that statements can be temporarily killed by commenting them
  32.    out illustrates the usefulness of a second type of comment delimiter.
  33.  
  34.    Try killing several of the WriteLn statements above by inserting
  35.    (*  to the left of the first statement to be killed and
  36.    *)  to the left of the statement AFTER the last statement to be killed.
  37.        Run the program to see the results.
  38.   }
  39.  
  40.   WriteLn;
  41.   Write  ('Check carefully when ');
  42.   Write  ('you run this program. ');
  43.   Write  ('How many lines ');
  44.   WriteLn('are printed');
  45.   WriteLn('by this last set of Write and WriteLn statements?');
  46.  
  47. END. {PRG3}
  48.